<?php
require_once dirname(__FILE__).'/../bootstrap/doctrine.php';
$t = new lime_test(19);

//测试提取营养学会介绍
$t->comment('1.Test function getIntroduction');
$t->comment('  1.1.getIntroduction() is a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getIntroduction(), 'staticinfomation');
$t->comment('  1.2.the result has 2 fields that id is 2 and name is ..');
$t->is($s->getId(), '2');
$t->is($s->getTitle(), '学会介绍');

//测试提取静态信息中的政策法规
$t->comment('2.Test function getPolicies');
$t->comment('  2.1.getPolicies() returns a Doctrine_collaction?');
$t->isa_ok(staticinfomationTable::getInstance()->getPolicies(), 'Doctrine_Collection');

//测试提取静态信息中的关于学会的集合
$t->comment('3.Test function getAbouts');
$t->comment('  3.1.getAbouts() returns a Doctrine_collaction?');
$t->isa_ok(staticinfomationTable::getInstance()->getAbouts(), 'Doctrine_Collection');

//测试提取理事会成员介绍
$t->comment('4.Test function getMembers');
$t->comment('  4.1.getMembers() is a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getMembers(), 'staticinfomation');
$t->comment('  4.2.the result has 3 fields that id is 3 and name is ..');
$t->is($s->getId(), '3');
$t->is($s->getTitle(), '理事会介绍');

//测试提取大事记
$t->comment('5.Test function getHistory');
$t->comment('  5.1.getHistory() is a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getHistory(), 'staticinfomation');
$t->comment('  5.2.the result has 2 fields that id is 4 and name is ..');
$t->is($s->getId(), '4');
$t->is($s->getTitle(), '大事记');

//测试提取版权信息
$t->comment('5.Test function getCopyright');
$t->comment('  5.1.getCopyright() is a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getCopyright(), 'staticinfomation');
$t->comment('  5.2.the result has 2 fields that id is 5 and name is ..');
$t->is($s->getId(), '5');
$t->is($s->getTitle(), '版权声明');

//测试获取最新的一条政策法规
$t->comment('6.Test function getLastPolicy');
$t->comment('  6.1.getLastPolicy() returns a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getLastPolicy(), 'staticinfomation');
$t->comment('  6.2.check the result');
$policy = Doctrine_core::getTable('staticinfomation')->findByAliasName('Policy6');
$t->is($s->getId(),$policy[0]->getId() );
unset($s, $policy);

//测试提取联系我们。个性化处理
$t->comment('7.Test function getContact');
$t->comment('  7.1.getContact() is a object of staticinfomation?');
$t->isa_ok($s = staticinfomationTable::getInstance()->getContact(), 'staticinfomation');
$t->comment('  7.2.the result has 1 fields that id is 5 and name is ..');
$t->is($s->getId(), '1');
$t->is($s->getTitle(), '联系我们');
unset($s);